<!DOCTYPE html>
<!--
这是一个入门模板页面。通过此页面从头开发新的项目。
该页面删除了所有链接，仅提供所需的标签。
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="x-ua-compatible" content="ie=edge">

  <title>SuperScope | 管理员维护</title>

  <!-- Font Awesome 图标 -->
  <link rel="stylesheet" href="../../static/plugins/fontawesome-free/css/all.min.css">
  <!-- 主题样式 -->
  <link rel="stylesheet" href="../../static/dist/css/adminlte.min.css">
  <link rel="stylesheet" href="../../static/dist/css/chat.css">
  <!-- 离线 Google 字体: Source Sans Pro -->
  <link href="../../static/dist/css/google.css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
</head>


<body class="hold-transition sidebar-mini">
<div class="wrapper">

  <!-- 导航栏 -->
  <nav class="main-header navbar navbar-expand navbar-white navbar-light">
    <!-- 左侧导航栏链接 -->
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
      </li>
      <li class="nav-item d-none d-sm-inline-block">
        <a href="{{ url_for('monitorMain') }}" class="nav-link">主页</a>
      </li>
    </ul>

    <!-- 搜索表单 -->
    <form class="form-inline ml-3">
      <div class="input-group input-group-sm">
        <input class="form-control form-control-navbar" type="search" placeholder="搜索" aria-label="Search">
        <div class="input-group-append">
          <button class="btn btn-navbar" type="submit">
            <i class="fas fa-search"></i>
          </button>
        </div>
      </div>
    </form>

    <!-- 右侧导航栏链接 -->
    <ul class="navbar-nav ml-auto">
      <li class="nav-item dropdown">
        <a class="nav-link" data-toggle="dropdown" href="#">
          <i class="far fa-bell"></i>
          <span class="badge badge-warning navbar-badge">15</span>
        </a>
        <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
          <span class="dropdown-header">15 条通知</span>
          <div class="dropdown-divider"></div>
          <a href="#" class="dropdown-item">
            <i class="fas fa-envelope mr-2"></i> 4 条新消息
            <span class="float-right text-muted text-sm">3 分钟前</span>
          </a>
          <div class="dropdown-divider"></div>
          <a href="#" class="dropdown-item">
            <i class="fas fa-users mr-2"></i> 8 个好友请求
            <span class="float-right text-muted text-sm">12 小时前</span>
          </a>
          <div class="dropdown-divider"></div>
          <a href="#" class="dropdown-item">
            <i class="fas fa-file mr-2"></i> 3 个新报告
            <span class="float-right text-muted text-sm">2 天前</span>
          </a>
          <div class="dropdown-divider"></div>
          <a href="#" class="dropdown-item dropdown-footer">查看所有通知</a>
        </div>
      </li>
      <li class="nav-item">
        <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button"><i
            class="fas fa-th-large"></i></a>
      </li>
    </ul>
  </nav>
  <!-- /.navbar -->

  <!-- 主侧边栏容器 -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- 品牌 Logo -->
    <a href="index3.html" class="brand-link">
      <img src="../../static/dist/img/periscope.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
           style="opacity: .8">
      <span class="brand-text font-weight-light">SuperScope</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      <!-- 侧边栏用户面板（可选） -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="info">
          <a href="#" id="HelloUser" class="d-block">Alexander Pierce</a>
        </div>
      </div>

      <!-- 侧边栏菜单 -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <!-- 使用 .nav-icon 类添加图标，
               或使用 font-awesome 或其他任何图标字体库 -->
            <li class="nav-item">
            <a href="{{ url_for('monitorMain') }}" class="nav-link active">
              <i class="nav-icon fas fa-th"></i>
              <p>
                首页
              </p>
            </a>
          </li>
            <li class="nav-item has-treeview">
            <a href="#" class="nav-link">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                监控
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
                <li class="nav-item">
                <a href="{{ url_for('infraRed') }}" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>红外监控</p>
                </a>
              </li>
                <li class="nav-item">
                <a href="{{ url_for('temperatureAndHumidity') }}" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>温湿度监控</p>
                </a>
              </li>
                <li class="nav-item">
                <a href="{{ url_for('door') }}" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>门监控</p>
                </a>
              </li>
            </ul>
          </li>
            <li class="nav-item">
            <a href="{{ url_for('sleepCheck') }}" class="nav-link">
              <i class="nav-icon fas fa-edit"></i>
              <p>
                查寝
              </p>
            </a>
          </li>
            <li class="nav-item">
            <a href="{{ url_for('personalInformation') }}" class="nav-link">
              <i class="nav-icon fas fa-file"></i>
              <p>
                个人信息
              </p>
            </a>
          </li>
            <li id="adminMaintenance" class="nav-item">
            <a href="{{ url_for('adminMaintenance') }}" class="nav-link">
              <i class="nav-icon fas fa-plus-square"></i>
              <p>
                管理员维护
              </p>
            </a>
          </li>
        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. 包含页面内容 -->
  <div class="content-wrapper">
    <!-- 内容标题（页面标题） -->
    <div class="abs cover contaniner">
    <div class="abs cover pnl">
      <div class="top pnl-head"></div>
      <div class="abs cover pnl-body" id="pnlBody">
        <div class="abs cover pnl-left">
          <div class="abs cover pnl-msgs scroll" id="show">
            <div   class="msg min time" id="histStart" >
                <a  href="{{ url_for('ALLchats') }}" class="msg min time" id="histStart" >加载历史消息</a>
            </div>
            <div class="pnl-list" id="hists">
              <!-- 历史消息 -->
            </div>
            <div id="chat_content">
                <div class="pnl-list" id="msgs">

                {% for chat in chats %}
                    {% if chat.speaker == userId %}
                    <div class="msg guest">
                        <div class="msg-right">
                          <div class="msg-host headDefault" style="background-image: url(../../static/dist/img/avatar2.png)"></div>
                          <div class="msg-ball" title="{{  chat.datetime  }}">{{ chat.content }}</div>
                        </div>
                       </div>
                    {% endif %}
                    {% if chat.speaker != userId %}

                          <div class="msg robot">
                            <div class="msg-left" worker="{{ chat.speaker }}">
                              <div class="msg-host photo" style="background-image: url(../../static/dist/img/avatar.png)"></div>
                              <div class="msg-ball" title="{{  chat.datetime  }}">{{ chat.content }}<br></div>
                            </div>
                          </div>
                    {% endif %}



                {% endfor %}
                </div>
            </div>
            <div class="pnl-list hide" id="unreadLine">
              <div class="msg min time unread">未读消息</div>
            </div>
          </div>
          <div class="abs bottom pnl-text">
            <div class="abs top pnl-warn" id="pnlWarn">
              <!-- <div class="fl btns rel pnl-warn-free">
                <img src="../Images/icon/Smile.png" class="kh warn-btn" title="表情" id="emojiBtn" />
                <img src="../Images/icon/pic.png" class="kh warn-btn" title="截屏" id="emojiBtn" />
                <img src="../Images/icon/camera.png" class="kh warn-btn" title="图片" id="emojiBtn" />
                <img src="../Images/icon/edit.png" class="kh warn-btn" title="保存" id="emojiBtn" />
              </div> -->
            </div>
            <div class="abs cover pnl-input">
              <textarea class="scroll" id="text" wrap="hard" placeholder="在此输入文字信息..."></textarea>
              <div class="abs atcom-pnl scroll hide" id="atcomPnl">
                <ul class="atcom" id="atcom"></ul>
              </div>
            </div>
            <div class="abs br pnl-btn" id="submit"
              style="background-color: rgb(32, 196, 202); color: rgb(255, 255, 255);" onclick="SendMsg()">发送</div>
            <!-- <div class="pnl-support" id="copyright"><a href="#">版权什么的</a></div> -->
          </div>
        </div>
        <div class="abs right pnl-right">
          <div class="slider-container hide"></div>
          <div class="pnl-right-content">
            <div class="pnl-tabs">
              <div class="tab-btn active" id="hot-tab">常见问题</div>
              <div class="tab-btn" id="rel-tab">相关问题</div>
            </div>
            <div class="pnl-hot">
              <ul class="rel-list unselect" id="hots">
                <!-- <li class="rel-item">这是一个问题，这是一个问题？</li> -->
              </ul>
            </div>
            <div class="pnl-rel" style="display: none;">
              <ul class="rel-list unselect" id="rels">
                <!-- <li class="rel-item">这是一个问题，这是一个问题？</li> -->
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
    <!-- /.content-header -->

    <!-- 主体内容 -->
    <div class="content">
      <div class="container-fluid">

      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- 控制侧边栏内容在这里 -->
    <div class="p-3">
      <h5>标题</h5>
      <p>侧边栏内容</p>
    </div>
  </aside>
  <!-- /.control-sidebar -->

  <!-- Main Footer -->
  <footer class="main-footer">
    <!-- To the right -->
    <div class="float-right d-none d-sm-inline">
      任何你想要的
    </div>
    <!-- Default to the left -->
    <strong>Copyright &copy; 2021 <a href="#">SuperScope.com</a>.</strong> 保留所有权利。
  </footer>
</div>
<!-- ./wrapper -->

<!-- 载入脚本 -->

<!-- jQuery -->
<script src="../../static/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../../static/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="../../static/dist/js/adminlte.min.js"></script>

<script type = "text/javascript" >

    {#function getALLChats(){#}
    {#            $.ajax({#}
    {#        type:"GET",#}
            {#dataType:"json",#}
    {#        url:"/monitor/ALLchats",#}
    {##}
    {#        success :function (){#}
    {#            //更新界面#}
    {#            window.location.reload()#}
    {##}
    {#        },#}
    {#        error:function (result){#}
    {#            toastr.error("未知错误");#}
    {#        }#}
    {#    });#}
    {#}#}

    function SendMsg(){
        var text = $('#text').val()
        console.log(text)


        $.ajax({
            type:"POST",
            {#dataType:"json",#}
            url:"/monitor/makeChat",
            data: {'text':text},
            success :function (){
                $('#text').val("")
                //更新界面
                window.location.reload()

            },
            error:function (result){
                toastr.error("未知错误");
            }
        });
    }
</script>



</body>
</html>
